import { toLocaleStringSupports } from './toLocaleStringSupports'

export function numberToFixed(number, n) {
  if (n === 2 && toLocaleStringSupports()) {
    return number.toLocaleString('zh', { style: 'currency', currency: 'cny' }).replace(/[^\d.-]/g, '')
  }
  return number.toFixed(n)
}
